﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.Experimental.Rendering.Universal;
using UnityEngine.Rendering.Universal;

public class UIRenderObject : RenderObjects
{
    UIRenderPass renderPass;
    public override void Create()
    {
        FilterSettings filter = settings.filterSettings;

        if (settings.Event < RenderPassEvent.AfterRendering)
            settings.Event = RenderPassEvent.AfterRendering;
        settings.filterSettings.RenderQueueType = RenderQueueType.Transparent;
        renderPass = new UIRenderPass(settings.passTag, settings.Event, filter.PassNames,
                filter.RenderQueueType, filter.LayerMask, settings.cameraSettings);
    }
    public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
    {
        //RenderTextureDescriptor cameraTargetDescriptor = renderingData.cameraData.cameraTargetDescriptor;

        renderPass.Setup(ref renderingData);
        renderer.EnqueuePass(renderPass);
    }
}